<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="按钮" onclick="f1()">
<script>
    /*无参无返回值*/
    function f1(){
        alert("点击了");
        console.log("f1");
    }
    //调用
    f1();
    //2.无参无返回值
    function f2(name,age){
        console.log(name+"："+age)
    }
    f2("孙尚香",90);
    //无参有返回值
    function f3(){
        return "牛逼牛逼";
    }
    let a = f3();
    console.log(a);
    //4:有参有返回值
    function f4(x,y){
        return x*y;
    }
    let result = f4(7,8);
    console.log(result);
    //第二种声明方法的方式
    let f5 = function (name,age){
        console.log(name+":"+age);
    }
     f5("亚瑟",17);
    //第三种声明方法的方式
    let f6 = new Function("name","age","console.log(name+':'+age)");
    f6("卢布",10);
</script>
</body>
</html>